import 'package:flutter_xiaomi/app/modules/address/services/address_service.dart';
import 'package:get/get.dart';

class OrderController extends GetxController {
  //TODO: Implement OrderController

  final AddressService _myService = Get.put(AddressService(),tag: "ser");

  final count = "".obs;
  @override
  void onInit() {
    super.onInit();

    // 在Controller初始化时监听Service中数据的变化
    ever<String>(_myService.data, (newData) {
      ///刷新controller对外的数据
      count.value = newData;
      print("OrderController${count.value}");
    });
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }

  void increment() {
    _myService.updateData("this is order data");
  }

}
